package org.liushao.dao.impl;

import org.liushao.dao.BookDao;
import org.liushao.entity.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * @program: untitled
 * @ClassName BookDaoImpl
 * @description:
 * @author: 刘庆东
 * @create: 2024−11-28 13:47
 * @Version 1.0
 **/
@Repository
public class BookDaoImpl  implements BookDao {
    //注入
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Override
    public void add(Book book) {
        String sql="insert into book (bname,bprice) values (?,?)";
        Object[] args={book.getBname(),book.getBprice()};
        int update = jdbcTemplate.update(sql, args);




    }
}
